#ifndef __GeoBaseDC__
#define __GeoBaseDC__
class CEpsDC ;
class AFX_EXT_CLASS CGeoBaseDC: public CDC
{
	DECLARE_DYNAMIC(CGeoBaseDC)
private:
	static CEpsDC* m_pEps ;
public:
	BOOL EpsOpen(double scale,CRect rect) ;
	BOOL EpsClose() ;
	CGeoBaseDC() ;
	~CGeoBaseDC() ;
public:
	CEpsDC* GetEpsDC() ;

	CPoint MoveTo(int x, int y);
	CPoint MoveTo(POINT point);
	BOOL LineTo(int x, int y);
	BOOL LineTo(POINT point);
	BOOL Arc(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4);
	BOOL Arc(LPCRECT lpRect, POINT ptStart, POINT ptEnd);
	BOOL Polyline(LPPOINT lpPoints, int nCount);

	BOOL AngleArc(int x, int y, int nRadius, float fStartAngle, float fSweepAngle);
	BOOL ArcTo(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4);
	BOOL ArcTo(LPCRECT lpRect, POINT ptStart, POINT ptEnd);

	BOOL PolyDraw(const POINT* lpPoints, const BYTE* lpTypes, int nCount);
	BOOL PolylineTo(const POINT* lpPoints, int nCount);
	BOOL PolyPolyline(const POINT* lpPoints,const DWORD* lpPolyPoints, int nCount);

	BOOL PolyBezier(const POINT* lpPoints, int nCount);
	BOOL PolyBezierTo(const POINT* lpPoints, int nCount);

	BOOL Chord(int x1, int y1, int x2, int y2, int x3, int y3,int x4, int y4);
	BOOL Chord(LPCRECT lpRect, POINT ptStart, POINT ptEnd);

	BOOL Ellipse(int x1, int y1, int x2, int y2);
	BOOL Ellipse(LPCRECT lpRect);
	BOOL Pie(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4);
	BOOL Pie(LPCRECT lpRect, POINT ptStart, POINT ptEnd);
	BOOL Polygon(LPPOINT lpPoints, int nCount);
	BOOL PolyPolygon(LPPOINT lpPoints, LPINT lpPolyCounts, int nCount);
	BOOL Rectangle(int x1, int y1, int x2, int y2);
	BOOL Rectangle(LPCRECT lpRect);
	BOOL RoundRect(int x1, int y1, int x2, int y2, int x3, int y3);
	BOOL RoundRect(LPCRECT lpRect, POINT point);

// Bitmap Functions
	BOOL BitBlt(int x, int y, int nWidth, int nHeight, CDC* pSrcDC,
		int xSrc, int ySrc, DWORD dwRop);
	BOOL StretchBlt(int x, int y, int nWidth, int nHeight, CDC* pSrcDC,
		int xSrc, int ySrc, int nSrcWidth, int nSrcHeight, DWORD dwRop);
	int StretchDIBits(int XDest,int YDest,int nDestWidth,int nDestHeight,int  XSrc,int  YSrc,
		int nSrcWidth,int nSrcHeight,CONST VOID * lpBits,CONST BITMAPINFO *  lpBitsInfo,UINT  iUsage, DWORD  dwRop);
// Text Functions
	virtual BOOL TextOut(int x, int y, LPCTSTR lpszString, int nCount);
			BOOL TextOut(int x, int y, const CString& str);
	virtual BOOL ExtTextOut(int x, int y, UINT nOptions, LPCRECT lpRect,
				LPCTSTR lpszString, UINT nCount, LPINT lpDxWidths);
			BOOL ExtTextOut(int x, int y, UINT nOptions, LPCRECT lpRect,
				const CString& str, LPINT lpDxWidths);
	virtual int DrawText( const CString& str, LPRECT lpRect, UINT nFormat );
	virtual int DrawText( LPCTSTR lpszString, int nCount, LPRECT lpRect, UINT nFormat );
// Path Functions
	BOOL BeginPath();
	BOOL EndPath();
	BOOL FillPath();
	BOOL StrokeAndFillPath();
	BOOL StrokePath();
public:
	virtual CGdiObject* SelectStockObject(int nIndex);
	CPen* SelectObject(CPen* pPen);
	CPen* SelectObject(CPen& Pen);
	CBrush* SelectObject(CBrush* pBrush);
	CBrush* SelectObject(CBrush& Brush);
	virtual CFont* SelectObject(CFont* pFont);
	virtual CFont* SelectObject(CFont& Font);
	CBitmap* SelectObject(CBitmap* pBitmap);
	int SelectObject(CRgn* pRgn);       // special return for regions
	CGdiObject* SelectObject(CGdiObject* pObject);

	int SetPolyFillMode(int nPolyFillMode);
	BOOL ShowEpsBitmap(CRect,CString);
	BOOL ShowEpsBitmap(CRect,int,int,int,LPVOID);
	BOOL SelectClipPath(int) ;

	void DPtoLP( LPPOINT lpPoints, int nCount = 1 ) ;
	void DPtoLP( LPRECT lpRect ) ;
	void DPtoLP( LPSIZE lpSize ) ;
	void LPtoDP( LPPOINT lpPoints, int nCount = 1 ) ;
	void LPtoDP( LPRECT lpRect ) ;
	void LPtoDP( LPSIZE lpSize ) ;
	HGDIOBJ SelectObject(HGDIOBJ obj) { return CDC::SelectObject(obj); };      // do not use for regions
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif
} ;
#endif